#include "picturethread.h"

#include <QDir>
#include <QString>
#include <QDebug>
#include <QPixmap>

PictureThread::PictureThread(QList<QPixmap *> *list, QString path,
                             QString prefix, QString suffix, int count, int time)
{
    this->list = list;
    this->path = path;
    this->prefix = prefix;
    this->suffix = suffix;
    this->count = count;
    this->time = time;
}

void PictureThread::run()
{
    for (int i = 0; i < count; i++) {
        QString p = path;
        QString filePath = p.append(prefix)
                               .append(QString::number(i))
                               .append(suffix);
        qDebug() << "thread: " << filePath;
        list->append(new QPixmap(filePath));
    }
}
